From: Roland McGrath Date: Wed, 31 Mar 1993 23:42:37 +0000 (+0000) Subject: (indent-for-comment): Use skip-syntax-backward in place of X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~96614 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=9d0f559a4d165fca10ebb0b202f382c34adb1fb5;p=emacs.git (indent-for-comment): Use skip-syntax-backward in place of skip-chars-backward. Correctly set INDENT to the return value of comment-indent-function. --- diff --git a/lisp/simple.el b/lisp/simple.el index ef6a011afdf..0a7a5bc19af 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1523,18 +1523,19 @@ the comment's starting delimiter.") ;; position at the end of the first pair. (if (match-end 1) (goto-char (match-end 1)) - ;; If comment-start-skip matched a string with internal - ;; whitespace (not final whitespace) then the delimiter - ;; start at the end of that whitespace. - ;; Otherwise, it starts at the beginning of what was matched. - (skip-chars-backward " \t" (match-beginning 0)) - (skip-chars-backward "^ \t" (match-beginning 0))))) + ;; If comment-start-skip matched a string with + ;; internal whitespace (not final whitespace) then + ;; the delimiter start at the end of that + ;; whitespace. Otherwise, it starts at the + ;; beginning of what was matched. + (skip-syntax-backward " " (match-beginning 0)) + (skip-syntax-backward "^ " (match-beginning 0))))) (setq begpos (point)) ;; Compute desired indent. (if (= (current-column) - (if comment-indent-hook - (funcall comment-indent-hook) - (funcall comment-indent-function))) + (setq indent (if comment-indent-hook + (funcall comment-indent-hook) + (funcall comment-indent-function)))) (goto-char begpos) ;; If that's different from current, change it. (skip-chars-backward " \t")